﻿using FileSystemCustomClasses.FileBrowserControl;
using ServiceLocator;

namespace FileTrackerWPF
{
	public class MainViewModel
	{
		public FileBrowserViewModel LeftFileBrowser { get; set; }
		public FileBrowserViewModel RightFileBrowser { get; set; }

		public MainViewModel()
		{
			//Get the configuration
			IConfigurationHandler localConfig = Locator.Resolve<IConfigurationHandler>();

			LeftFileBrowser = new FileBrowserViewModel();
			RightFileBrowser = new FileBrowserViewModel();

			//Add Favorites first so the control can check them for navigation
			LeftFileBrowser.AddFavoriteRange(localConfig.FavoriteList);
			RightFileBrowser.AddFavoriteRange(localConfig.FavoriteList);

			LeftFileBrowser.SetPath(localConfig.LeftDefaultDir);
			RightFileBrowser.SetPath(localConfig.RightDefaultDir);
		}

	}
}